<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>

  <body>
    <div id="app"></div>
    <script>
      class Phone {
        constructor(name, price) {
          this.name = name
          this.price = price
        }
        call() {
          console.log("打电话")
        }
      }
      class smartPhone extends Phone {
        constructor(name, price, color, size) {
          super(name, price)
          this.color = color
          this.size = size
        }
        play() {
          console.log("玩游戏")
        }
      }
      let apple = new smartPhone("苹果", 5999, "黑色", "5.5")
      console.log(apple)
    </script>
  </body>
</html>
